Transparent Programmer-Directed Garbage Collection for C++
نویسندگان
چکیده
A number of possible approaches to automatic memory management in C++ have been considered over the years. Here we propose the reconsideration of an approach that relies on partially conservative garbage collection. Its principal advantage is that objects referenced by ordinary pointers may be garbage-collected. Unlike other approaches, this makes it possible to garbage-collect objects allocated and manipulated by most legacy libraries. This makes it much easier to convert existing code to a garbage-collected environment. It also means that it can be used, for example, to “repair” legacy code with deficient memory management. The approach taken here is similar to that taken by Bjarne Stroustrup’s much earlier proposal (N0932=96-0114). Based on prior discussion on the core reflector, this version does insist that implementations make an attempt at garbage collection if so requested by the application. However, since there is no real notion of space usage in the standard, there is no way to make this a substantive requirement. An implementation that “garbage collects” by deallocating all collectable memory at process exit will remain conforming, though it is likely to be unsatisfactory for some uses.
منابع مشابه
The Visualization of Dynamic Memory Management in the Icon Programming Language
The management of storage — allocation and garbage collection — is intended to be transparent to the programmer and user, placing the burden on the implementation. In most situations, the Icon programmer does not need to think about the allocation of storage or its consequences on program performance. Nonetheless, in cases where the amount of memory is limited or where programs require unusuall...
متن کاملGarbage Collection in Distributed Object Systems
Large-scale, distributed computer systems are less reliable than their smallscale, non-distributed counterparts. A significant proportion of the reliability problems are due to the very poor scalability of manual storage management techniques—the reclamation of unused storage in particular. The bulk of automatic garbage reclamation in both message-passing and shared memory systems, with certain...
متن کاملOBIWAN: Design and Implementation of a Middleware Platform
Programming distributed applications supporting data sharing is very hard. In most middleware platforms, programmers must deal with system-level issues for which they do not have the adequate knowledge, e.g., object replication, abusive resource consumption by mobile agents, and distributed garbage collection. As a result, programmers are diverted from their main task: the application logic. In...
متن کاملConservative Garbage Collection on Distributed Shared Memory Systems
In this paper we present the design and implementationof a conservative garbage collection algorithm for distributed shared memory (DSM) applications that use weakly–typed languages like C or C++, and evaluate its performance. In the absence of language support to identify references, our algorithm constructed a conservative approximation of the set of cross–node references based on local infor...
متن کاملThe Measured Cost of Conservative Garbage Collection University of Colorado at Boulder the Measured Cost of Conservative Garbage Collection
Because dynamic memory management is an important part of a large class of computer programs, high-performance algorithms for dynamic memory management have been, and will continue to be, of considerable interest. Experience indicates that for many programs, dynamic storage allocation is so important that programmers feel compelled to write and use their own domain-speciic allocators to avoid t...
متن کامل